
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@page import="org.springframework.security.context.SecurityContextHolder"%>
<%@page import="com.googlecode.garbagecan.springsecuritystudy.user.UserInfo"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
		<ul>
			<li>username : <sec:authentication property="name"/></li>
			<li>email : <sec:authentication property="principal.email"/></li>
		</ul>
		<%
			UserInfo userInfo = (UserInfo) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
			out.println(userInfo);
		%>
		<div>
			<a href="index.jsp">Index</a>
			<a href="j_spring_security_logout">Logout</a>
		</div>
    </body>
</html>
